<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Agile Modbus: /home/runner/work/agile_modbus/agile_modbus/src/agile_modbus_rtu.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Agile Modbus
   &#160;<span id="projectnumber">1.1.4</span>
   </div>
   <div id="projectbrief">Lightweight modbus protocol stack.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('agile__modbus__rtu_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">agile_modbus_rtu.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Agile Modbus package RTU source file.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="agile__modbus_8h_source.html">agile_modbus.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="agile__modbus__rtu_8h_source.html">agile_modbus_rtu.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for agile_modbus_rtu.c:</div>
<div class="dyncontent">
<div class="center"><img src="agile__modbus__rtu_8c__incl.png" border="0" usemap="#a_2home_2runner_2work_2agile__modbus_2agile__modbus_2src_2agile__modbus__rtu_8c" alt=""/></div>
<map name="a_2home_2runner_2work_2agile__modbus_2agile__modbus_2src_2agile__modbus__rtu_8c" id="a_2home_2runner_2work_2agile__modbus_2agile__modbus_2src_2agile__modbus__rtu_8c">
<area shape="rect" title="Agile Modbus package RTU source file." alt="" coords="86,5,284,61"/>
<area shape="rect" href="agile__modbus_8h.html" title="Agile Modbus software package common header file." alt="" coords="73,109,198,136"/>
<area shape="rect" href="agile__modbus__rtu_8h.html" title="Agile Modbus package RTU header file." alt="" coords="199,184,350,211"/>
<area shape="rect" title=" " alt="" coords="63,259,134,285"/>
<area shape="rect" href="agile__modbus__tcp_8h.html" title="Agile Modbus package TCP header file." alt="" coords="22,184,174,211"/>
</map>
</div>
</div>
<p><a href="agile__modbus__rtu_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga917aedd343bdcfd4d4a7b9fc80db2a17"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga917aedd343bdcfd4d4a7b9fc80db2a17">agile_modbus_rtu_crc16</a> (uint8_t *buffer, uint16_t buffer_length)</td></tr>
<tr class="memdesc:ga917aedd343bdcfd4d4a7b9fc80db2a17"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU CRC16 calculation.  <a href="group___r_t_u___private___functions.html#ga917aedd343bdcfd4d4a7b9fc80db2a17">More...</a><br /></td></tr>
<tr class="separator:ga917aedd343bdcfd4d4a7b9fc80db2a17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga904257d5d6c88f9f81447bc0accf9b62"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga904257d5d6c88f9f81447bc0accf9b62">agile_modbus_rtu_set_slave</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, int slave)</td></tr>
<tr class="memdesc:ga904257d5d6c88f9f81447bc0accf9b62"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU sets the address interface.  <a href="group___r_t_u___private___functions.html#ga904257d5d6c88f9f81447bc0accf9b62">More...</a><br /></td></tr>
<tr class="separator:ga904257d5d6c88f9f81447bc0accf9b62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga604461d9c9522b5352ceda519eeae006"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga604461d9c9522b5352ceda519eeae006">agile_modbus_rtu_build_request_basis</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, int function, int addr, int nb, uint8_t *req)</td></tr>
<tr class="memdesc:ga604461d9c9522b5352ceda519eeae006"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU builds the basic request message interface (header message)  <a href="group___r_t_u___private___functions.html#ga604461d9c9522b5352ceda519eeae006">More...</a><br /></td></tr>
<tr class="separator:ga604461d9c9522b5352ceda519eeae006"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0bbede450717d31223094f8e795e0e89"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga0bbede450717d31223094f8e795e0e89">agile_modbus_rtu_build_response_basis</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gaa551bce4815f2889224102ac08f779ad">agile_modbus_sft_t</a> *sft, uint8_t *rsp)</td></tr>
<tr class="memdesc:ga0bbede450717d31223094f8e795e0e89"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU builds the basic response message interface (header message)  <a href="group___r_t_u___private___functions.html#ga0bbede450717d31223094f8e795e0e89">More...</a><br /></td></tr>
<tr class="separator:ga0bbede450717d31223094f8e795e0e89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacd396678c9cc5a5c77cba6615eb212bd"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#gacd396678c9cc5a5c77cba6615eb212bd">agile_modbus_rtu_prepare_response_tid</a> (const uint8_t *req, int *req_length)</td></tr>
<tr class="memdesc:gacd396678c9cc5a5c77cba6615eb212bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU ready response interface.  <a href="group___r_t_u___private___functions.html#gacd396678c9cc5a5c77cba6615eb212bd">More...</a><br /></td></tr>
<tr class="separator:gacd396678c9cc5a5c77cba6615eb212bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1cb91eb00f06868c4c5b85e67f7ef126"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga1cb91eb00f06868c4c5b85e67f7ef126">agile_modbus_rtu_send_msg_pre</a> (uint8_t *req, int req_length)</td></tr>
<tr class="memdesc:ga1cb91eb00f06868c4c5b85e67f7ef126"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU pre-send data interface.  <a href="group___r_t_u___private___functions.html#ga1cb91eb00f06868c4c5b85e67f7ef126">More...</a><br /></td></tr>
<tr class="separator:ga1cb91eb00f06868c4c5b85e67f7ef126"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa7ff9945c4910eafae9b737957ae6cad"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#gaa7ff9945c4910eafae9b737957ae6cad">agile_modbus_rtu_check_integrity</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, uint8_t *msg, const int msg_length)</td></tr>
<tr class="memdesc:gaa7ff9945c4910eafae9b737957ae6cad"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU check received data integrity interface (CRC16 comparison)  <a href="group___r_t_u___private___functions.html#gaa7ff9945c4910eafae9b737957ae6cad">More...</a><br /></td></tr>
<tr class="separator:gaa7ff9945c4910eafae9b737957ae6cad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc4beee96e865a624d3d8129633c8765"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#gabc4beee96e865a624d3d8129633c8765">agile_modbus_rtu_pre_check_confirmation</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, const uint8_t *req, const uint8_t *rsp, int rsp_length)</td></tr>
<tr class="memdesc:gabc4beee96e865a624d3d8129633c8765"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU pre-check confirmation interface (request response address comparison)  <a href="group___r_t_u___private___functions.html#gabc4beee96e865a624d3d8129633c8765">More...</a><br /></td></tr>
<tr class="separator:gabc4beee96e865a624d3d8129633c8765"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga96821440a21db41bb7b662ea8ff346ec"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___exported___functions.html#ga96821440a21db41bb7b662ea8ff346ec">agile_modbus_rtu_init</a> (<a class="el" href="group___r_t_u___exported___types.html#ga784ce38d941cd22dba8bfcd6bc4db435">agile_modbus_rtu_t</a> *ctx, uint8_t *send_buf, int send_bufsz, uint8_t *read_buf, int read_bufsz)</td></tr>
<tr class="memdesc:ga96821440a21db41bb7b662ea8ff346ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU initialization.  <a href="group___r_t_u___exported___functions.html#ga96821440a21db41bb7b662ea8ff346ec">More...</a><br /></td></tr>
<tr class="separator:ga96821440a21db41bb7b662ea8ff346ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ga04218c2c5446512594e32a18242ef1e9"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___constants.html#ga04218c2c5446512594e32a18242ef1e9">_table_crc_hi</a> []</td></tr>
<tr class="memdesc:ga04218c2c5446512594e32a18242ef1e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Table of CRC values for high-order byte.  <a href="group___r_t_u___private___constants.html#ga04218c2c5446512594e32a18242ef1e9">More...</a><br /></td></tr>
<tr class="separator:ga04218c2c5446512594e32a18242ef1e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae2ed306ffd807efd1a62f33caf690135"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___constants.html#gae2ed306ffd807efd1a62f33caf690135">_table_crc_lo</a> []</td></tr>
<tr class="memdesc:gae2ed306ffd807efd1a62f33caf690135"><td class="mdescLeft">&#160;</td><td class="mdescRight">Table of CRC values for low-order byte.  <a href="group___r_t_u___private___constants.html#gae2ed306ffd807efd1a62f33caf690135">More...</a><br /></td></tr>
<tr class="separator:gae2ed306ffd807efd1a62f33caf690135"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga380ad4931059280836d853cde7bcee43"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="group___c_o_m_m_o_n___exported___types.html#ga3de0b082d8d88e159d162bcf78ef123c">agile_modbus_backend_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___constants.html#ga380ad4931059280836d853cde7bcee43">agile_modbus_rtu_backend</a></td></tr>
<tr class="memdesc:ga380ad4931059280836d853cde7bcee43"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU backend interface.  <a href="group___r_t_u___private___constants.html#ga380ad4931059280836d853cde7bcee43">More...</a><br /></td></tr>
<tr class="separator:ga380ad4931059280836d853cde7bcee43"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Agile Modbus package RTU source file. </p>
<dl class="section author"><dt>Author</dt><dd>Ma Longwei (<a href="#" onclick="location.href='mai'+'lto:'+'254'+'40'+'472'+'13'+'@qq'+'.c'+'om'; return false;">25440<span style="display: none;">.nosp@m.</span>4721<span style="display: none;">.nosp@m.</span>3@qq.<span style="display: none;">.nosp@m.</span>com</a>) </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2021-12-02</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd></dd></dl>
<h2><center>&copy; Copyright (c) 2021 Ma Longwei. All rights reserved.</center></h2>

<p class="definition">Definition in file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="agile__modbus__rtu_8c.html">agile_modbus_rtu.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
